package cn.itcast.nems.config;

import cn.itcast.nems.manager.eca.ECAManager;
import cn.itcast.nems.manager.kc.KeyCloakManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

@Configuration
public class ECAManagerConfig {
    @Value("${eca.domain}")
    private String ecaDomain;
    @Value("${eca.client.sysClientId}")
    private String sysClientId;
    @Value("${eca.client.dataScope}")
    private String dataScope;

    @Bean
    @DependsOn(value = {"keyCloakManager"})
    public ECAManager ecaManager(KeyCloakManager keyCloakManager) {
        return new ECAManager(ecaDomain,keyCloakManager, sysClientId, dataScope);
    }
}
